package com.wcy.feign.perm;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wcy.entity.Permission;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "cloud-provider-perm",contextId = "FeignPermissionService")
public interface FeignPermissionService {
    @GetMapping("permission/page")
    public ResponseEntity<Page<Permission>> getPage(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                    @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);
    @GetMapping("permission/list")
    public ResponseEntity<List<Permission>> getList();
    @PostMapping("permission/add")
    public ResponseEntity<Void> add(@RequestBody Permission permission);
    @PutMapping("permission/update")
    public ResponseEntity<Void> update(@RequestBody Permission permission);
    @DeleteMapping("permission/delete/{id}")
    public ResponseEntity<Void> delete(@PathVariable("id") Integer id);
}
